<?php

use yii\db\Schema;
use yii\db\Migration;

class m160623_031741_add_mobile_adspace_multi_size extends Migration
{
    public function up()
    {
        $this->addColumn("{{%mobile_adspace}}", "ext_size", "text COMMENT '逗号分隔不同的 宽*高' after height");
        $sql = "update {{%mobile_adspace}} set ext_size = concat(width, '*', height)";
        $this->execute($sql);
        return true;
    }

    public function down()
    {
        $this->dropColumn("{{%mobile_adspace}}", "ext_size");
        return true;
    }

    /*
    // Use safeUp/safeDown to run migration code within a transaction
    public function safeUp()
    {
    }

    public function safeDown()
    {
    }
    */
}
